In [19]:
import numpy
from IPython import parallel
c = parallel.Client()
d = c[:]
d.block = True
import pidigits
%px import pidigits
fs = ['basics-data/pi200m.ascii.0{0}of20'.format(i) for i in xrange(1, 3)]

In [44]:
for f in fs:
    pidigits.fetch_pi_file(f)

In [20]:
@d.parallel(block = True)
def two_digit_freqs (fs):
    out = []
    for f in fs:
        g = pidigits.txt_file_to_digits(f)
        #l = []
        #while len(l) < 1000000:
            #l.append(next(g))
        out.append(pidigits.two_digit_freqs(g))#iter(l)))
    return out

freqs = two_digit_freqs(fs)
freqs = pidigits.reduce_freqs(freqs)
pidigits.plot_two_digit_freqs(freqs)


Out[20]:
<matplotlib.image.AxesImage at 0x23686d0>

In [9]:
run basics-data/mcpricer


Strike prices:  [  90.   94.   98.  102.  106.  110.]
Volatilities:  [ 0.1    0.175  0.25   0.325  0.4  ]
Submitted tasks:  30
Parallel calculation completed, time = 5.18445396423 s